package de.backtomedieval.units;

import de.backtomedieval.R;
import de.backtomedieval.game.Costs;
import de.backtomedieval.main.Game;
import de.backtomedieval.research.Technology;

public class Archer extends AbstractUnit {
	//*******************************************
	private static final int _healthpoints = 50;
	private static final int _attackMultiple = 2;
	private static final int _attack = 15;
	private static final int _defense = 2;
	private static final int _attackquality = 25;
	private static final int[] _attackRounds = {4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20};
	private static Costs costSetting = null;
	private static final int _buildPoints = 100;	
	//*******************************************

	public Archer(Technology technology) {		
		super(_healthpoints, _attack, _defense, _attackquality, _attackMultiple, _attackRounds, _buildPoints);
		if (technology != null) this.setAttack(_attack + technology.getArcherAttackBonus());
		if (technology != null) this.setDefense(_defense + technology.getArcherDefenseBonus());
		if (costSetting == null){
			costSetting = new Costs();
			costSetting.setLumberCost(10);
			costSetting.setIronCost(10);
			costSetting.setGoldCost(10);
			}
		this.setCosts(costSetting);
		System.out.println("New Archer with " + this.getAttack() + " Attack");
	}
	
	@Override
	public String getName(int count) {
		if (count==1) return Game.getString(R.string.unit_archer);
		return Game.getString(R.string.unit_archer_pl);
	}
	
	@Override
	public Integer getImage() {
		return R.drawable.archer;
	}

	@Override
	public int getBuildIn() {
		return AbstractUnit.BUILD_IN_BARRACKS;
	}

	public static int getBaseAttack() {
		return _attack;
	}
	
	public static int getBaseDefense() {
		return _defense;
	}
	
}
